# -*- coding: utf-8 -*-

import MatchDirectory as md
import grabAllContent as gac

class Web_data_crawling_QuGeWang:

    def add_book_info(self,book_id_list):
        """
        设置 取的 id
        :param book_id_list:  需要爬取的小说的 id 数组 ,id 获取方式  看  readme.md
        :return:
        """
        for bookid in book_id_list:
            md.book_info(bookid)
            md.match_directory(bookid)

    def run(self):
        books = md.Book.find_all()
        for books in books:
            gac.run(bookid=books.id)

if __name__ == '__main__':
    caozuo = Web_data_crawling_QuGeWang()

    caozuo.add_book_info([5094])
    caozuo.run()